package com.booksystem.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.booksystem.entity.ShippingMethod;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

/**
 * <p>
 * 配送方式 Mapper 接口
 * </p>
 * @author 段伟豪
 */
public interface ShippingMethodMapper extends BaseMapper<ShippingMethod> {
    
    /**
     * 根据配送方式名称查询是否存在
     *
     * @param shippingMethod 配送方式名称
     * @return 是否存在
     */
    @Select("SELECT COUNT(*) > 0 FROM shipping_method WHERE shipping_method = #{shippingMethod}")
    boolean existsByShippingMethod(@Param("shippingMethod") String shippingMethod);
}